package org.myfram.flink.flinkonjar.common.config;

import org.myfram.flink.flinkonjar.common.properties.KafkaProperties;

import java.util.Properties;

public class KafkaConfig {

    public static Properties getSinkProps(KafkaProperties.KafkaSinkConfig config) {
        Properties props = new Properties();
        props.put("bootstrap.servers", config.getBootstrapServers());
        return props;
    }

    public static Properties getSourceProps(KafkaProperties.KafkaSourceConfig config) {
        Properties props = new Properties();
        props.put("bootstrap.servers", config.getBootstrapServers());
        props.put("group.id", config.getGroupId());
        props.put("auto.offset.reset", config.getStartingOffsets());
        return props;
    }

}
